<?php

namespace app\service;

abstract class BaseService {

    protected $CORE;
    protected $logpath = '';

    public function __construct() {
        $this->CORE = getInstance();
    }

    protected function recordObject(\stdClass $obj) {
        if (!$this->logpath) {
            return;
        }

        $msg = sprintf('%s | %s | %s', isset($obj->method_name) ? $obj->method_name : 'none', isset($obj->line) ? $obj->line : 0, isset($obj->message) ? $obj->message : '');
        $this->CORE->logfactory->recordMsg('biz', $this->logpath . '_' . date('Ymd'), $msg);
    }
}
